from menu import main_menu
from fun import fun
import re
def main():
    ctrl = True
    while(ctrl):
        main_menu.menu()
        option = input("请选择: ")
        option_str = re.sub("\D","",option) # 提取数字
        if option_str in ['0','1','2','3','4','5','6','7']:
            option_int = int(option_str)
            if option_int == 0:
                print("您已经推出学生信息管理系统")
                ctrl = False
            elif option_int == 1:
                fun.insert()
            elif option_int == 2:
                fun.search()
            elif option_int == 3:
                fun.delete()
            elif option_int == 4:
                fun.modify()
            elif option_int == 5:
                fun.sort()
            elif option_int == 6:
                fun.total()
            elif option_int == 7:
                fun.show()

if __name__ == "__main__":
    main()